class Forums < Controller
    helper :forum_functions
    map '/forum'
    
    def index(forum_id = nil)
        redirect r(:list) unless forum_id
        
        forum = get_forum(forum_id)
        @forum_id = forum_id
        @forum_name = forum.name
        @topics = forum.topics
        
        @forum_path = forum_path(forum)
    end
    
    def show(forum_id)
        forum = get_forum(forum_id)
        @forum_href = r(:index, forum_id)
        @forum_name = forum.name
        @forum_desc = forum.description
        @forum_img = forum.image
    end
    
    def list
        @forums = Forum.all
        @title = "Test"
        
        @forum_path = forum_path
    end

end
